home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / haddock.lang < prev    next >
Extensible Markup Language  |  2009-10-02  |  6KB  |  162 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Authors: Duncan Coutts
  5.  Copyright (C) 2007 Duncan Coutts <duncan@haskell.org>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="haddock" _name="Haddock" version="2.0" _section="Markup" hidden="true">
  24.  
  25.   <styles>
  26.     <style id="markup"     _name="Inline Haddock Section" map-to="def:doc-comment"/>
  27.     <style id="directive"  _name="Haddock Directive" map-to="def:doc-comment-element"/>
  28.     <style id="identifier" _name="Hyperlinked Identifier" map-to="def:doc-comment-element"/>
  29.     <style id="module"     _name="Hyperlinked Module Name" map-to="def:doc-comment-element"/>
  30.     <style id="escape"     _name="Escape" map-to="def:special-char"/>
  31.     <style id="emphasis"   _name="Emphasis" map-to="def:doc-comment-element"/>
  32.     <style id="monospace"  _name="Monospace" />
  33.     <style id="codeblock"  _name="Code Block" />
  34.     <style id="property"   _name="Header Property" map-to="def:doc-comment-element"/>
  35.     <style id="itemized"   _name="Itemized list" map-to="def:doc-comment-element"/>
  36.     <style id="enumerated" _name="Enumerated list" map-to="def:doc-comment-element"/>
  37.     <style id="definition" _name="Definition list" map-to="def:doc-comment-element"/>
  38.     <style id="url"        _name="URL" map-to="def:underlined"/>
  39.     <style id="anchor"     _name="Anchor" map-to="def:doc-comment-element"/>
  40.   </styles>
  41.  
  42.   <definitions>
  43.     <context id="haddock">
  44.       <include>
  45.         <!-- Spec: http://haskell.org/haddock/haddock-html-0.8/markup.html -->
  46.  
  47.         <context id="escape" style-ref="escape" extend-parent="true">
  48.           <match>\\[/'`"@#<*-]</match>
  49.         </context>
  50.  
  51.         <context id="character-reference" style-ref="escape">
  52.             <match>&#([0-9]+|x[a-fA-F0-9]+);</match>
  53.         </context>
  54.  
  55.         <context id="identifier" style-ref="identifier" extend-parent="false">
  56.           <match>'[a-zA-Z_][0-9a-zA-Z._'#]*'</match>
  57.         </context>
  58.  
  59.         <context id="module" style-ref="module" extend-parent="false">
  60.           <match>"[A-Z][0-9a-zA-Z._']*"</match>
  61.         </context>
  62.  
  63.         <context id="emphasis" style-ref="emphasis" extend-parent="false">
  64.           <start>/</start>
  65.           <end>/</end>
  66.           <include>
  67.             <context ref="escape"/>
  68.             <context ref="character-reference"/>
  69.           </include>
  70.         </context>
  71.  
  72.         <context id="monospace" style-ref="monospace" extend-parent="false">
  73.           <start>@</start>
  74.           <end>@</end>
  75.           <include>
  76.             <context ref="escape"/>
  77.             <context ref="character-reference"/>
  78.           </include>
  79.         </context>
  80.  
  81.         <context id="codeblock" style-ref="codeblock">
  82.           <match>^\s*--+\s+>.*$</match>
  83.         </context>
  84.  
  85.         <context id="property" extend-parent="false">
  86.           <match>^\s*--+\s+([A-Z][a-zA-Z0-9'_]*)\s*:.*$</match>
  87.           <include>
  88.             <context sub-pattern="1" style-ref="property"/>
  89.           </include>
  90.         </context>
  91.  
  92.         <context id="list-item" extend-parent="false">
  93.           <match extended="true">
  94.             ^(\s*--+)?\s+             # line start possibly with line comment
  95.             ( \*(?=\s) | -(?=\s)      # bulleted item
  96.             | \([0-9]\) | [0-9]\.     # enumerated item
  97.             | \[@[a-zA-Z0-9._'\#]*@\] # definition list item
  98.             )
  99.           </match>
  100.           <include>
  101.             <context sub-pattern="2" style-ref="itemized" />
  102.           </include>
  103.         </context>
  104.  
  105.         <context id="url" style-ref="url" extend-parent="false">
  106.           <match><.*></match>
  107.         </context>
  108.  
  109.         <context id="anchor" style-ref="anchor" extend-parent="false">
  110.           <match>#[a-z][0-9a-zA-Z_']*#|[A-Z][0-9a-zA-Z._']*#[a-z][0-9a-zA-Z_']*+</match>
  111.         </context>
  112.  
  113.         <!-- haddock markup inside Haskell line comments -->
  114.         <context id="line-paragraph" style-ref="markup" extend-parent="true" end-parent="true">
  115.           <start>\s+([|^*$]+)</start>
  116.           <end>^(?!\s*--+)</end>
  117.           <include>
  118.             <context ref="escape"/>
  119.             <context ref="character-reference"/>
  120.             <context ref="identifier"/>
  121.             <context ref="module"/>
  122.             <context ref="emphasis"/>
  123.             <context ref="monospace"/>
  124.             <context ref="codeblock"/>
  125.             <context ref="property"/>
  126.             <context ref="list-item"/>
  127.             <context ref="url"/>
  128.             <context ref="anchor"/>
  129.           </include>
  130.         </context>
  131.  
  132.         <!-- haddock markup inside Haskell block comment -->
  133.         <context id="block-paragraph" style-ref="markup" extend-parent="false">
  134.           <start>(?<={-)\s?[|^*$]</start>
  135.           <include>
  136.             <context ref="escape"/>
  137.             <context ref="character-reference"/>
  138.             <context ref="identifier"/>
  139.             <context ref="module"/>
  140.             <context ref="emphasis"/>
  141.             <context ref="monospace"/>
  142.             <context ref="codeblock"/>
  143.             <context ref="property"/>
  144.             <context ref="list-item"/>
  145.             <context ref="url"/>
  146.             <context ref="anchor"/>
  147.           </include>
  148.         </context>
  149.  
  150.         <context id="directive" style-ref="directive">
  151.           <prefix>#</prefix>
  152.           <keyword>hide</keyword>
  153.           <keyword>prune</keyword>
  154.           <keyword>ignore-exports</keyword>
  155.         </context>
  156.  
  157.       </include>
  158.     </context>
  159.  
  160.   </definitions>
  161. </language>
  162.